<form id="form_aluno" name="form_aluno" class="form-horizontal"
	action="<?php echo url_for('aluno/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id_aluno='.$form->getObject()->getIdAluno() : '')) ?>"
	method="post">
	
<table class="table table-bordered table-condensed">
	<tr>
		<th width="120px"><?php echo $form['nm_aluno']->renderLabel() ?></th>
		<td><?php echo $form['nm_aluno'] ?><?php echo form_error('nm_aluno'); ?></td>
		<th width="120px"><?php echo $form['tp_sexo']->renderLabel() ?></th>
		<td><?php echo $form['tp_sexo'] ?><?php echo form_error('tp_sexo'); ?></td>
	</tr>	
	<tr>
		<th><?php echo $form['dt_nascimento']->renderLabel() ?></th>
		<td><?php echo $form['dt_nascimento'] ?><?php echo form_error('dt_nascimento'); ?></td>
		<th><?php echo $form['ds_naturalidade']->renderLabel() ?></th>
		<td><?php echo $form['ds_naturalidade'] ?><?php echo form_error('ds_naturalidade'); ?></td>
	</tr>	
	<tr>
		<th><?php echo $form['st_pais_juntos']->renderLabel() ?></th>
		<td><?php echo $form['st_pais_juntos'] ?><?php echo form_error('st_pais_juntos'); ?></td>
		<th><?php echo $form['nu_fone_1']->renderLabel() ?></th>
		<td><?php echo $form['nu_fone_1'] ?><?php echo form_error('nu_fone_1'); ?></td>
	</tr>
	<tr>
		<th><?php echo $form['nu_fone_2']->renderLabel() ?></th>
		<td><?php echo $form['nu_fone_2'] ?><?php echo form_error('nu_fone_2'); ?></td>
		<th><?php echo $form['nu_fone_3']->renderLabel() ?></th>
		<td><?php echo $form['nu_fone_3'] ?><?php echo form_error('nu_fone_3'); ?></td>
	</tr>
	
	<tr>
		<th><?php echo $form['endereco']['nu_cep']->renderLabel(); ?></th>
		<td><?php echo $form['endereco']['nu_cep'] ?><?php echo form_error('nu_cep'); ?></td>
		<th><?php echo $form['endereco']['logradouro']->renderLabel(); ?></th>
		<td><?php echo $form['endereco']['logradouro'] ?><?php echo form_error('logradouro'); ?></td>
	</tr>
	<tr>
		<th><?php echo $form['endereco']['cidade']->renderLabel(); ?></th>
		<td><?php echo $form['endereco']['cidade'] ?><?php echo form_error('cidade'); ?></td>
		<th><?php echo $form['endereco']['bairro']->renderLabel(); ?></th>
		<td><?php echo $form['endereco']['bairro'] ?><?php echo form_error('bairro'); ?></td>
	</tr>
	<tr>
		<th><?php echo $form['endereco']['sg_uf']->renderLabel(); ?></th>
		<td colspan="3"><?php echo $form['endereco']['sg_uf'] ?><?php echo form_error('sg_uf'); ?></td>
	</tr>
	<tr>
		<th><?php echo $form['st_transporte_escolar']->renderLabel(); ?></th>
		<td><?php echo $form['st_transporte_escolar'] ?><?php echo form_error('st_transporte_escolar'); ?></td>
		<th><?php echo $form['nm_transporte_escolar']->renderLabel(); ?></th>
		<td><?php echo $form['nm_transporte_escolar'] ?><?php echo form_error('nm_transporte_escolar'); ?></td>
	</tr>
	<tr>
		<th><?php echo $form['nm_motorista_transporte_escolar']->renderLabel(); ?></th>
		<td><?php echo $form['nm_motorista_transporte_escolar'] ?><?php echo form_error('nm_motorista_transporte_escolar'); ?></td>
		<th><?php echo $form['nu_telefone_transporte_escolar']->renderLabel(); ?></th>
		<td><?php echo $form['nu_telefone_transporte_escolar'] ?><?php echo form_error('nu_telefone_transporte_escolar'); ?></td>
	</tr>
	<tr>
		<th><?php echo $form['st_aluno']->renderLabel(); ?></th>
		<td colspan="3"><?php echo $form['st_aluno'] ?><?php echo form_error('st_aluno'); ?></td>
	</tr>
</table>
		
<div id="turmas"></div>

<?php
	comandos_form(
		link_to(
			':: Voltar ::',
			$sf_context->getModuleName().'/list',
			array('class' => 'btn')
		),
		submit_tag(':: Salvar ::', array('class' => 'btn btn-primary'))
	);
?>
</form>

<script type="text/javascript">
$(function(){
	$('#aluno_dt_nascimento').mask('99/99/9999');
	$('#aluno_dt_nascimento_pai').mask('99/99/9999');
	$('#aluno_nu_telefone_celular_pai').mask('(99) 9999-9999');
	$('#aluno_nu_telefone_comercial_pai').mask('(99) 9999-9999');
	$('#aluno_dt_nascimento_mae').mask('99/99/9999');
	$('#aluno_nu_telefone_celular_mae').mask('(99) 9999-9999');
	$('#aluno_nu_telefone_comercial_mae').mask('(99) 9999-9999');
	$('#aluno_nu_fone_1').mask('(99) 9999-9999');
	$('#aluno_nu_fone_2').mask('(99) 9999-9999');
	$('#aluno_nu_fone_3').mask('(99) 9999-9999');
	$('#aluno_endereco_nu_cep').mask('99999-999');
	$('#aluno_nu_telefone_transporte_escolar').mask('(99) 9999-9999');

	System.formdata.save(new Array("msgAlerta", "Atenção:"));
    System.loaddata.blur('#aluno_dt_nascimento', '#turmas', '<?php echo url_for('turma_ano_letivo/disponibilidade');?>');
});
</script>